<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/c++/5/bits/stl_iterator_base_types.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">usr/include/c++/5/bits</a> - stl_iterator_base_types.h<span style="font-size: 80%;"> (source / <a href="stl_iterator_base_types.h.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntryHi">-</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Types used in iterator implementation -*- C++ -*-</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : // Copyright (C) 2001-2015 Free Software Foundation, Inc.
<span class="lineNum">       4 </span>            : //
<span class="lineNum">       5 </span>            : // This file is part of the GNU ISO C++ Library.  This library is free
<span class="lineNum">       6 </span>            : // software; you can redistribute it and/or modify it under the
<span class="lineNum">       7 </span>            : // terms of the GNU General Public License as published by the
<span class="lineNum">       8 </span>            : // Free Software Foundation; either version 3, or (at your option)
<span class="lineNum">       9 </span>            : // any later version.
<span class="lineNum">      10 </span>            : 
<span class="lineNum">      11 </span>            : // This library is distributed in the hope that it will be useful,
<span class="lineNum">      12 </span>            : // but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      13 </span>            : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class="lineNum">      14 </span>            : // GNU General Public License for more details.
<span class="lineNum">      15 </span>            : 
<span class="lineNum">      16 </span>            : // Under Section 7 of GPL version 3, you are granted additional
<span class="lineNum">      17 </span>            : // permissions described in the GCC Runtime Library Exception, version
<span class="lineNum">      18 </span>            : // 3.1, as published by the Free Software Foundation.
<span class="lineNum">      19 </span>            : 
<span class="lineNum">      20 </span>            : // You should have received a copy of the GNU General Public License and
<span class="lineNum">      21 </span>            : // a copy of the GCC Runtime Library Exception along with this program;
<span class="lineNum">      22 </span>            : // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
<span class="lineNum">      23 </span>            : // &lt;http://www.gnu.org/licenses/&gt;.
<span class="lineNum">      24 </span>            : 
<span class="lineNum">      25 </span>            : /*
<span class="lineNum">      26 </span>            :  *
<span class="lineNum">      27 </span>            :  * Copyright (c) 1994
<span class="lineNum">      28 </span>            :  * Hewlett-Packard Company
<span class="lineNum">      29 </span>            :  *
<span class="lineNum">      30 </span>            :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      31 </span>            :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      32 </span>            :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      33 </span>            :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      34 </span>            :  * in supporting documentation.  Hewlett-Packard Company makes no
<span class="lineNum">      35 </span>            :  * representations about the suitability of this software for any
<span class="lineNum">      36 </span>            :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      37 </span>            :  *
<span class="lineNum">      38 </span>            :  *
<span class="lineNum">      39 </span>            :  * Copyright (c) 1996-1998
<span class="lineNum">      40 </span>            :  * Silicon Graphics Computer Systems, Inc.
<span class="lineNum">      41 </span>            :  *
<span class="lineNum">      42 </span>            :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      43 </span>            :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      44 </span>            :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      45 </span>            :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      46 </span>            :  * in supporting documentation.  Silicon Graphics makes no
<span class="lineNum">      47 </span>            :  * representations about the suitability of this software for any
<span class="lineNum">      48 </span>            :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      49 </span>            :  */
<span class="lineNum">      50 </span>            : 
<span class="lineNum">      51 </span>            : /** @file bits/stl_iterator_base_types.h
<span class="lineNum">      52 </span>            :  *  This is an internal header file, included by other library headers.
<span class="lineNum">      53 </span>            :  *  Do not attempt to use it directly. @headername{iterator}
<span class="lineNum">      54 </span>            :  *
<span class="lineNum">      55 </span>            :  *  This file contains all of the general iterator-related utility types,
<span class="lineNum">      56 </span>            :  *  such as iterator_traits and struct iterator.
<span class="lineNum">      57 </span>            :  */
<span class="lineNum">      58 </span>            : 
<span class="lineNum">      59 </span>            : #ifndef _STL_ITERATOR_BASE_TYPES_H
<span class="lineNum">      60 </span>            : #define _STL_ITERATOR_BASE_TYPES_H 1
<span class="lineNum">      61 </span>            : 
<span class="lineNum">      62 </span>            : #pragma GCC system_header
<span class="lineNum">      63 </span>            : 
<span class="lineNum">      64 </span>            : #include &lt;bits/c++config.h&gt;
<span class="lineNum">      65 </span>            : 
<span class="lineNum">      66 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">      67 </span>            : # include &lt;type_traits&gt;  // For __void_t, is_convertible
<span class="lineNum">      68 </span>            : #endif
<span class="lineNum">      69 </span>            : 
<span class="lineNum">      70 </span>            : namespace std _GLIBCXX_VISIBILITY(default)
<span class="lineNum">      71 </span>            : {
<span class="lineNum">      72 </span>            : _GLIBCXX_BEGIN_NAMESPACE_VERSION
<span class="lineNum">      73 </span>            : 
<span class="lineNum">      74 </span>            :   /**
<span class="lineNum">      75 </span>            :    *  @defgroup iterators Iterators
<span class="lineNum">      76 </span>            :    *  Abstractions for uniform iterating through various underlying types.
<span class="lineNum">      77 </span>            :   */
<span class="lineNum">      78 </span>            :   //@{ 
<span class="lineNum">      79 </span>            : 
<span class="lineNum">      80 </span>            :   /**
<span class="lineNum">      81 </span>            :    *  @defgroup iterator_tags Iterator Tags
<span class="lineNum">      82 </span>            :    *  These are empty types, used to distinguish different iterators.  The
<span class="lineNum">      83 </span>            :    *  distinction is not made by what they contain, but simply by what they
<span class="lineNum">      84 </span>            :    *  are.  Different underlying algorithms can then be used based on the
<span class="lineNum">      85 </span>            :    *  different operations supported by different iterator types.
<span class="lineNum">      86 </span>            :   */
<span class="lineNum">      87 </span>            :   //@{ 
<span class="lineNum">      88 </span>            :   ///  Marking input iterators.
<span class="lineNum">      89 </span>            :   struct input_iterator_tag { };
<span class="lineNum">      90 </span>            : 
<span class="lineNum">      91 </span>            :   ///  Marking output iterators.
<span class="lineNum">      92 </span>            :   struct output_iterator_tag { };
<span class="lineNum">      93 </span>            : 
<span class="lineNum">      94 </span>            :   /// Forward iterators support a superset of input iterator operations.
<span class="lineNum">      95 </span>            :   struct forward_iterator_tag : public input_iterator_tag { };
<span class="lineNum">      96 </span>            : 
<span class="lineNum">      97 </span>            :   /// Bidirectional iterators support a superset of forward iterator
<span class="lineNum">      98 </span>            :   /// operations.
<span class="lineNum">      99 </span>            :   struct bidirectional_iterator_tag : public forward_iterator_tag { };
<span class="lineNum">     100 </span>            : 
<span class="lineNum">     101 </span>            :   /// Random-access iterators support a superset of bidirectional
<span class="lineNum">     102 </span>            :   /// iterator operations.
<span class="lineNum">     103 </span>            :   struct random_access_iterator_tag : public bidirectional_iterator_tag { };
<span class="lineNum">     104 </span>            :   //@}
<span class="lineNum">     105 </span>            : 
<span class="lineNum">     106 </span>            :   /**
<span class="lineNum">     107 </span>            :    *  @brief  Common %iterator class.
<span class="lineNum">     108 </span>            :    *
<span class="lineNum">     109 </span>            :    *  This class does nothing but define nested typedefs.  %Iterator classes
<span class="lineNum">     110 </span>            :    *  can inherit from this class to save some work.  The typedefs are then
<span class="lineNum">     111 </span>            :    *  used in specializations and overloading.
<span class="lineNum">     112 </span>            :    *
<span class="lineNum">     113 </span>            :    *  In particular, there are no default implementations of requirements
<span class="lineNum">     114 </span>            :    *  such as @c operator++ and the like.  (How could there be?)
<span class="lineNum">     115 </span>            :   */
<span class="lineNum">     116 </span>            :   template&lt;typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
<span class="lineNum">     117 </span>            :            typename _Pointer = _Tp*, typename _Reference = _Tp&amp;&gt;
<span class="lineNum">     118 </span>            :     struct iterator
<span class="lineNum">     119 </span>            :     {
<span class="lineNum">     120 </span>            :       /// One of the @link iterator_tags tag types@endlink.
<span class="lineNum">     121 </span>            :       typedef _Category  iterator_category;
<span class="lineNum">     122 </span>            :       /// The type &quot;pointed to&quot; by the iterator.
<span class="lineNum">     123 </span>            :       typedef _Tp        value_type;
<span class="lineNum">     124 </span>            :       /// Distance between iterators is represented as this type.
<span class="lineNum">     125 </span>            :       typedef _Distance  difference_type;
<span class="lineNum">     126 </span>            :       /// This type represents a pointer-to-value_type.
<span class="lineNum">     127 </span>            :       typedef _Pointer   pointer;
<span class="lineNum">     128 </span>            :       /// This type represents a reference-to-value_type.
<span class="lineNum">     129 </span>            :       typedef _Reference reference;
<span class="lineNum">     130 </span>            :     };
<span class="lineNum">     131 </span>            : 
<span class="lineNum">     132 </span>            :   /**
<span class="lineNum">     133 </span>            :    *  @brief  Traits class for iterators.
<span class="lineNum">     134 </span>            :    *
<span class="lineNum">     135 </span>            :    *  This class does nothing but define nested typedefs.  The general
<span class="lineNum">     136 </span>            :    *  version simply @a forwards the nested typedefs from the Iterator
<span class="lineNum">     137 </span>            :    *  argument.  Specialized versions for pointers and pointers-to-const
<span class="lineNum">     138 </span>            :    *  provide tighter, more correct semantics.
<span class="lineNum">     139 </span>            :   */
<span class="lineNum">     140 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     141 </span>            :   // _GLIBCXX_RESOLVE_LIB_DEFECTS
<span class="lineNum">     142 </span>            :   // 2408. SFINAE-friendly common_type/iterator_traits is missing in C++14
<span class="lineNum">     143 </span>            :   template&lt;typename _Iterator, typename = __void_t&lt;&gt;&gt;
<span class="lineNum">     144 </span>            :     struct __iterator_traits { };
<span class="lineNum">     145 </span>            : 
<span class="lineNum">     146 </span>            :   template&lt;typename _Iterator&gt;
<span class="lineNum">     147 </span>            :     struct __iterator_traits&lt;_Iterator,
<span class="lineNum">     148 </span>            :                              __void_t&lt;typename _Iterator::iterator_category,
<span class="lineNum">     149 </span>            :                                       typename _Iterator::value_type,
<span class="lineNum">     150 </span>            :                                       typename _Iterator::difference_type,
<span class="lineNum">     151 </span>            :                                       typename _Iterator::pointer,
<span class="lineNum">     152 </span>            :                                       typename _Iterator::reference&gt;&gt;
<span class="lineNum">     153 </span>            :     {
<span class="lineNum">     154 </span>            :       typedef typename _Iterator::iterator_category iterator_category;
<span class="lineNum">     155 </span>            :       typedef typename _Iterator::value_type        value_type;
<span class="lineNum">     156 </span>            :       typedef typename _Iterator::difference_type   difference_type;
<span class="lineNum">     157 </span>            :       typedef typename _Iterator::pointer           pointer;
<span class="lineNum">     158 </span>            :       typedef typename _Iterator::reference         reference;
<span class="lineNum">     159 </span>            :     };
<span class="lineNum">     160 </span>            : 
<span class="lineNum">     161 </span>            :   template&lt;typename _Iterator&gt;
<span class="lineNum">     162 </span>            :     struct iterator_traits
<span class="lineNum">     163 </span>            :     : public __iterator_traits&lt;_Iterator&gt; { };
<span class="lineNum">     164 </span>            : #else
<span class="lineNum">     165 </span>            :   template&lt;typename _Iterator&gt;
<span class="lineNum">     166 </span>            :     struct iterator_traits
<span class="lineNum">     167 </span>            :     {
<span class="lineNum">     168 </span>            :       typedef typename _Iterator::iterator_category iterator_category;
<span class="lineNum">     169 </span>            :       typedef typename _Iterator::value_type        value_type;
<span class="lineNum">     170 </span>            :       typedef typename _Iterator::difference_type   difference_type;
<span class="lineNum">     171 </span>            :       typedef typename _Iterator::pointer           pointer;
<span class="lineNum">     172 </span>            :       typedef typename _Iterator::reference         reference;
<span class="lineNum">     173 </span>            :     };
<span class="lineNum">     174 </span>            : #endif
<span class="lineNum">     175 </span>            : 
<span class="lineNum">     176 </span>            :   /// Partial specialization for pointer types.
<span class="lineNum">     177 </span>            :   template&lt;typename _Tp&gt;
<span class="lineNum">     178 </span>            :     struct iterator_traits&lt;_Tp*&gt;
<span class="lineNum">     179 </span>            :     {
<span class="lineNum">     180 </span>            :       typedef random_access_iterator_tag iterator_category;
<span class="lineNum">     181 </span>            :       typedef _Tp                         value_type;
<span class="lineNum">     182 </span>            :       typedef ptrdiff_t                   difference_type;
<span class="lineNum">     183 </span>            :       typedef _Tp*                        pointer;
<span class="lineNum">     184 </span>            :       typedef _Tp&amp;                        reference;
<span class="lineNum">     185 </span>            :     };
<span class="lineNum">     186 </span>            : 
<span class="lineNum">     187 </span>            :   /// Partial specialization for const pointer types.
<span class="lineNum">     188 </span>            :   template&lt;typename _Tp&gt;
<span class="lineNum">     189 </span>            :     struct iterator_traits&lt;const _Tp*&gt;
<span class="lineNum">     190 </span>            :     {
<span class="lineNum">     191 </span>            :       typedef random_access_iterator_tag iterator_category;
<span class="lineNum">     192 </span>            :       typedef _Tp                         value_type;
<span class="lineNum">     193 </span>            :       typedef ptrdiff_t                   difference_type;
<span class="lineNum">     194 </span>            :       typedef const _Tp*                  pointer;
<span class="lineNum">     195 </span>            :       typedef const _Tp&amp;                  reference;
<span class="lineNum">     196 </span>            :     };
<span class="lineNum">     197 </span>            : 
<span class="lineNum">     198 </span>            :   /**
<span class="lineNum">     199 </span>            :    *  This function is not a part of the C++ standard but is syntactic
<span class="lineNum">     200 </span>            :    *  sugar for internal library use only.
<span class="lineNum">     201 </span>            :   */
<span class="lineNum">     202 </span>            :   template&lt;typename _Iter&gt;
<span class="lineNum">     203 </span>            :     inline typename iterator_traits&lt;_Iter&gt;::iterator_category
<span class="lineNum">     204 </span>            :     __iterator_category(const _Iter&amp;)
<span class="lineNum">     205 </span>            :     { return typename iterator_traits&lt;_Iter&gt;::iterator_category(); }
<span class="lineNum">     206 </span>            : 
<span class="lineNum">     207 </span>            :   //@}
<span class="lineNum">     208 </span>            : 
<span class="lineNum">     209 </span>            :   // If _Iterator has a base returns it otherwise _Iterator is returned
<span class="lineNum">     210 </span>            :   // untouched
<span class="lineNum">     211 </span>            :   template&lt;typename _Iterator, bool _HasBase&gt;
<span class="lineNum">     212 </span>            :     struct _Iter_base
<span class="lineNum">     213 </span>            :     {
<span class="lineNum">     214 </span>            :       typedef _Iterator iterator_type;
<span class="lineNum">     215 </span>            :       static iterator_type _S_base(_Iterator __it)
<span class="lineNum">     216 </span><span class="lineCov">          4 :       { return __it; }</span>
<span class="lineNum">     217 </span>            :     };
<span class="lineNum">     218 </span>            : 
<span class="lineNum">     219 </span>            :   template&lt;typename _Iterator&gt;
<span class="lineNum">     220 </span>            :     struct _Iter_base&lt;_Iterator, true&gt;
<span class="lineNum">     221 </span>            :     {
<span class="lineNum">     222 </span>            :       typedef typename _Iterator::iterator_type iterator_type;
<span class="lineNum">     223 </span>            :       static iterator_type _S_base(_Iterator __it)
<span class="lineNum">     224 </span>            :       { return __it.base(); }
<span class="lineNum">     225 </span>            :     };
<span class="lineNum">     226 </span>            : 
<span class="lineNum">     227 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     228 </span>            :   template&lt;typename _InIter&gt;
<span class="lineNum">     229 </span>            :     using _RequireInputIter = typename
<span class="lineNum">     230 </span>            :       enable_if&lt;is_convertible&lt;typename
<span class="lineNum">     231 </span>            :                 iterator_traits&lt;_InIter&gt;::iterator_category,
<span class="lineNum">     232 </span>            :                                input_iterator_tag&gt;::value&gt;::type;
<span class="lineNum">     233 </span>            : #endif
<span class="lineNum">     234 </span>            : 
<span class="lineNum">     235 </span>            : _GLIBCXX_END_NAMESPACE_VERSION
<span class="lineNum">     236 </span>            : } // namespace
<span class="lineNum">     237 </span>            : 
<span class="lineNum">     238 </span>            : #endif /* _STL_ITERATOR_BASE_TYPES_H */
<span class="lineNum">     239 </span>            : 
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
